﻿using Persistencia;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dlls
{
  public  class NivelInstrucaoDLL
    {
      Context context;

      public NivelInstrucaoDLL()
        {
            context = new Context();
        }
        public IEnumerable<NivelInstrucao> List()
        {
            return (from o in context.NivelInstrucao select o).ToList();
        }
        public NivelInstrucao getNivel(int codigo)
        {
            return context.NivelInstrucao.SingleOrDefault(e => e.Codigo == codigo);
        }
        public NivelInstrucao GetCodigoPorNome(string Nome)
        {
            return context.NivelInstrucao.SingleOrDefault(e => e.Descricao == Nome);
        }
    }
}
